package base.juc;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.concurrent.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

// 阿里巴巴强制自定义线程池
public class ThreadPoolDemo {
    public static void main(String[] args) {
        ExecutorService threadPool = new ThreadPoolExecutor(
                2,
                5,
                2L,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(3),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy()
        );
    }

    public void t1(){
        // 可重复锁，默认是非公平锁,可以设置参数为true改为公平锁
        ReentrantLock reentrantLock = new ReentrantLock();
        HashMap<Object, Object> map = new HashMap<>();

    }
}
